;;; init-flycheck.el --- flycheck config -*- lexical-binding:t -*-
;;; Commentary:
;;; Code:

;; flycheck 错误检查框架
(use-package flycheck
  :defer t
  :hook (prog-mode . flycheck-mode)
  :config
  (setq flycheck-display-errors-function #'flycheck-display-error-messages-unless-error-list)
  )

;; flycheck-posframe 错误检查弹框
(use-package flycheck-posframe
  :defer t
  :after flycheck
  :custom-face
  (flycheck-posframe-face ((t (:foreground ,(face-foreground 'success)))))
  (flycheck-posframe-info-face ((t (:foreground ,(face-foreground 'success)))))
  :hook (flycheck-mode . flycheck-posframe-mode)
  :init
  (setq flycheck-posframe-border-width 4
        flycheck-posframe-inhibit-functions
        '((lambda (&rest _) (bound-and-true-p company-backend)))))

;; flycheck color
(use-package flycheck-color-mode-line
  :defer t
  :after flycheck
  :hook (flycheck-mode . flycheck-color-mode-line-mode))

(provide 'init-flycheck)
;;; init-flycheck.el ends here
